package com.wuyangnju.template.runner;

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;

public class EmbededJettyRunner {
	public static void main(String[] args) throws Exception {
		int port = Integer.parseInt(args[0]);
		String contextPath = args[1];
		String war = args[2];

		Server server = new Server(port);
		WebAppContext webapp = new WebAppContext();
		webapp.setContextPath(contextPath);
		webapp.setWar(war);
		server.setHandler(webapp);
		server.start();
		server.join();
	}
}
